
from base.Base import Base
from selenium.webdriver.common.by import By
import time
class Page_loginWar(Base):
    #点击进入登录页面
    button_loc={By.XPATH,'/html/body/div/div/section/aside/ul/li/ul/li[4]/a'}
    def button(self):
        self.click(self.button_loc)
    #点击输入用户名
    username_loc={By.XPATH,'/html/body/div/div/section/section/main/div[1]/div[2]/div[1]/div/input'}
    def username(self):
        self.send_keys(self.username_loc,'13228720890')
    #点击输入密码
    password_loc={By.XPATH,'/html/body/div/div/section/section/main/div[1]/div[2]/div[2]/div/input'}
    def password(self):
        self.send_keys(self.password_loc,'123456')
    #点击立即登录
    login_button={By.XPATH,'/html/body/div/div/section/section/main/div[1]/div[2]/button[2]'}
    def login(self):
        self.click(self.login_button)
    #点击确认
    queren_loc={By.XPATH,'/html/body/div/div/section/section/main/div[2]/div/div/div/div[2]/button[2]'}
    def queren(self):
        self.click(self.queren_loc)
    def login_right(self):
        self.openurl("http://localhost:8080/")
        time.sleep(2)
        self.button()
        time.sleep(2)
        self.username()
        time.sleep(2)
        self.password()
        time.sleep(2)
        self.login()
        time.sleep(2)
        self.queren()
        time.sleep(2)

